﻿var url = window.location.href.split('?')[0];
//alert(url);
var redirectURL = url + "?";

var lochref = location.href;
lochref.match(/\?(.+)$/);
var params = RegExp.$1;
var params = params.split("&");
//alert(params);

var q = {};
var prt = "";
var keyword2 = "";
var errURL = "";
var hsimp = "";

for (var i = 0; i < params.length; i++) {
    var t = params[i].split("=");
    q[t[0]] = unescape(t[1]);
}

for (var i in q) {
    var qv = q[i];
    var lc = i.toLowerCase();
    if (lc == "keyword2") {
        if (qv.length > 0) keyword2 = qv;
    }
    else {
        if (lc != "keywords") {
            redirectURL = redirectURL + lc + "=" + qv + "&";
        }
    }

}

if (keyword2.length > 0) {
    redirectURL = redirectURL + "keywords=" + keyword2;
    location.href = redirectURL;
    //alert(redirectURL);
}